import { Typography } from 'antd';
import { defaultProps, ComponentProps } from './interface';
import { CSSProperties, FC } from 'react';
import { getParagraphList } from '@/comon/tools';

const { Paragraph } = Typography;

const Component: FC<ComponentProps> = (props) => {
  const { isCenter, text } = { ...defaultProps, ...props };

  const style: CSSProperties = {
    textAlign: isCenter ? 'center' : 'start',
    marginBottom: 0,
  };

  return <Paragraph style={style}>{getParagraphList(text)}</Paragraph>;
};

export default Component;
